<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\AddressInfo
 *
 * @property int $id
 * @property int $pid
 * @property string|null $province
 * @property string|null $city
 * @property string|null $area
 * @property string|null $town
 * @property string|null $deleted_at
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Query\Builder|\App\AddressInfo onlyTrashed()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereArea($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereCity($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo wherePid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereProvince($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereTown($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\AddressInfo whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\AddressInfo withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\AddressInfo withoutTrashed()
 * @mixin \Eloquent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\AddressInfo[] $children
 * @property-read \App\AddressInfo $parent
 */
class AddressInfo extends Model
{
    protected $table="address_info";
    use SoftDeletes;

    public function children(){
        return $this->hasMany('App\AddressInfo',"pid");
    }

    public function parent(){
        return $this->belongsTo('App\AddressInfo',"pid");
    }
}
